from django.shortcuts import render
from django.db import connection

def index(request):
    cursor = connection.cursor()
    #插入数据
    # cursor.execute("insert into book(name,author) values('论什么的产后抚养','wangfanxiong'),('论持久','91wangfan')")
    sql="select count(*) from book"
    cursor.execute(sql)
    rows = cursor.fetchall()
    for row in rows:
        print(row)



    return render(request,'index.html')